//
//  RegistrationConfirmPatientCell.swift
//  EyeVisionForPatients
//
//  Created by qdsg on 2020/4/20.
//  Copyright © 2020 QDSG. All rights reserved.
//

import UIKit

struct SERegistrationConfirmPatientCellModel {
    var titleText: String = ""
    var memoPlaceHolder: String = "请选择"
    var memoText: String = ""
    var isHiddenArrow: Bool = false
    var memoTextColor: UIColor {
        return memoText.isEmpty ? Asset.textLight.color : Asset.textDark.color
    }
    var memoShowText: String {
        return memoText.isEmpty ? memoPlaceHolder : memoText
    }
}

class SERegistrationConfirmPatientCell: UITableViewCell {

    static let className = "SERegistrationConfirmPatientCell"
    static let reuseId = className
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var patientLabel: UILabel!
    @IBOutlet weak var arrowImgView: UIImageView!

    var isHiddenArrow: Bool {
        get {
            return arrowImgView.isHidden
        }
        set {
            arrowImgView.isHidden = newValue
        }
    }

    func updateCell(model: SERegistrationConfirmPatientCellModel) {
        titleLabel.text = model.titleText
        patientLabel.text = model.memoShowText
        arrowImgView.isHidden = model.isHiddenArrow
        patientLabel.textColor = model.memoTextColor
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
